package com.QRcodeBuilder;

import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;

import com.enetiy.Users;

public class NetQrVo {
	private static HashMap<String, NetQrEntity> NetQrEntityMap = new HashMap<String,NetQrEntity>();
	private static HashMap<String, String > uuidMap = new HashMap<String,String>();
	private static HashMap<String, NetQrPCEntity> NetQrPCEntityMap = new HashMap<String,NetQrPCEntity>();
    private  static NetQrVo NetQrVo;
    
    public static NetQrVo getNetQrVo(){
        if(NetQrVo == null){
        	NetQrVo = new NetQrVo();
        }
        return NetQrVo;
    }
    public  HashMap<String, NetQrEntity> getNetQrEntityMap() {
        return NetQrEntityMap;
    }
    public  HashMap<String, NetQrPCEntity> getNetQrPCEntityMap() {
        return NetQrPCEntityMap;
    }
    public HashMap<String, String> getUuidMap(){
    	return uuidMap;
    }
    
    
    /**
	 * 删除map集合锁
	 * @param map
	 */
	public void Mapdelete(HashMap map){
		Iterator iterator = map.keySet().iterator(); 
		synchronized (iterator) {
			while (iterator.hasNext()) { 
			    String key = (String) iterator.next();
			    long str = Long.parseLong(key.substring(0, 13));
			    if ( new Date().getTime()-str > 300000){
			    	iterator.remove();  
			   }  
			}
		}
		
	}
}
